package com.eddie.recursion;

public class RecursionTest {

    public static void main(String[] args) {
        //通过打印回顾递归调用机制
        System.out.println(factorial(3));
    }

    public static int factorial(int n) {
        return n == 1 ? 1 : factorial(n - 1) * n;
    }

    //打印问题
    public static void test(int n) {
        if (n > 2) {
            test(n - 1);
        } else {

            System.out.println(n);
        }
    }
}
